package com.yuzhi.master.drainRRmst.mapper;

import com.yuzhi.common.core.mapper.BaseMapperPlus;
import com.yuzhi.master.drainRRmst.domain.DrainRRmst;
import com.yuzhi.master.drainRRmst.domain.vo.DrainRRmstVo;
import com.yuzhi.master.drainRRmst.domain.vo.FacilitylogDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Map;

@Mapper
public interface IDraRRmstMapper extends BaseMapperPlus<IDraRRmstMapper,DrainRRmst, DrainRRmstVo> {

    Map<String, Long> getSttpCount();

    Long wmstCount();

    boolean insertFacilitylog(FacilitylogDto dto);

    /**
     * 根据经纬度查询最近的雨量站(sttp=4)
     * @param longitude 经度
     * @param latitude 纬度
     * @return 最近的雨量站信息
     */
    DrainRRmst findNearestRainfallStation(@Param("longitude") BigDecimal longitude, 
                                         @Param("latitude") BigDecimal latitude);
}